<?php

    require_once('../modele/Utilisateur.class.php');
    require_once('../acces_donnees/AccesDonneesProjet.class.php');
    require_once('../acces_donnees/AccesDonneesActivite.class.php');
    require_once('../modele/Projet.class.php');
    require_once('../modele/Activite.class.php');
    
    session_start();
    
    if (!empty($_SESSION['utilisateur']) && !empty($_POST['nom_activite']) && !empty($_POST['date_echeance_activite']))
    {        
        $activite = new Activite($_POST['id_activite'], $_POST['nom_activite'], $_POST['priorite_activite'],
                                 $_POST['date_creation_activite'], $_POST['date_echeance_activite'], $_POST['etat_activite'], null);
            
        $accesActivite = new AccesDonneesActivite($activite, null, $_SESSION['utilisateur']);
        $etatModificationActivite = $accesActivite->miseAJour();
        
        $_SESSION['etatGestionActivite'] = $etatModificationActivite;
        header('Location: c_racine.php?page=gestion_activite');
    }
?>
